#ifndef LOSTTANKWINDOW_H
#define LOSTTANKWINDOW_H

#include <QMainWindow>
#include <QMap>
#include <QTimer>
#include <QKeyEvent>
#include "arena.h"
#include "objectfactory.h"


namespace Ui {
class LostTankWindow;
}

class LostTankWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit LostTankWindow(QWidget *parent = 0);
    ~LostTankWindow();

    QGraphicsScene topScene;
    Arena arena;
    QGraphicsScene bottomScene;

    QGraphicsTextItem angle;
    QGraphicsTextItem speed;
    QGraphicsTextItem shield;
    QGraphicsTextItem health;
    QGraphicsTextItem xcord;
    QGraphicsTextItem ycord;
    QGraphicsTextItem packages;
    QGraphicsTextItem objectives;




    enum Action { FORWARD, BACK, ROTATE_LEFT, ROTATE_RIGHT, BRAKE, FIRE, AUTO_OBJECTIVE, AUTO_PACKAGE,LEAD,GRID,EXIT };
    QMap<int,Action> actions;

    static bool pressedForward;
    static bool pressedBack;
    static bool pressedRotateLeft;
    static bool pressedRotateRight;
    static bool pressedBrake;
    static bool pressedFire;
    static bool pressedAutoObjective;
    static bool pressedAutoPackage;
    static bool pressedLead;
    static bool pressedGrid;


    static float speedCoefficient;

    QTimer timer;



public slots:
    void keyPressEvent(QKeyEvent *event);
    void keyReleaseEvent(QKeyEvent *event);


private:
    Ui::LostTankWindow *ui;
    void processPlayer(Player* player);
    void processArena();
    void processObjectives();
    void processBullets();


private slots:
    void mainClock();
};

#endif // LOSTTANKWINDOW_H
